package com.shadow.demo;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.web.bind.annotation.RestController;

/**
 * 针对测试、生产环境打成war包后放入外置Tomcat启动配置.
 * 1、继承SpringBootServletInitializer
 * 2、重写configure方法
 */
@SpringBootApplication
@ServletComponentScan
@RestController
public class ShiroInitializer extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(this.getClass());
    }
}
